package com.peanut.baby.mvp.settings;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.peanut.baby.InitManager;
import com.peanut.baby.R;
import com.peanut.baby.mvp.BaseMvpActivity;
import com.peanut.devlibrary.widget.TitleLayout;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by anonymouslystudio on 2017/9/1.
 */

public class SettingsActivity extends BaseMvpActivity implements View.OnClickListener,
        TitleLayout.OnTitleClickListener{

    @BindView(R.id.title)
    TitleLayout title;
    @BindView(R.id.settings_logout)
    TextView logout;

    public static void start(Context ctx) {
        ctx.startActivity(new Intent(ctx, SettingsActivity.class));
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);
        ButterKnife.bind(this);

        title.setTitle("设置");
        title.setOnTitleClickedListener(this);
        logout.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.settings_logout:
                InitManager.getInstance().logout(this);
                break;
        }
    }

    @Override
    public void onTitleBackClicked() {
        finish();
    }

    @Override
    public void onTitleRightClicked() {

    }

    @Override
    public void onTitleClicked() {

    }
}
